package cn.itcast.bos.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.AreaDao;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.service.base.AreaService;

@Service
@Transactional
public class AreaServiceImpl implements AreaService {
	// 注入Dao
	@Autowired
	private AreaDao ad;

	@Override
	public void saveBatch(List<Area> list) {
		ad.save(list);
	}

	@Override
	public Page<Area> findPageData(Specification<Area> sf, Pageable pb) {
		return ad.findAll(sf, pb);
	}

	@Override
	public void delete(String[] split) {
		for (String id : split) {
			ad.delete(id);
		}
	}
}
